package java6699.lesson01;
import java.util.Arrays;
public class Shopping6699 {
    public static void main(String[] args) {
        //创建商品，并添加在售商品
        Product6699 p1 = new Product6699();
        Product6699 p2 = new Product6699();
        Product6699 p3 = new Product6699();
        p1.setName("豆浆机");
        p2.setName("吹风机");
        p3.setName("空调机");
        Market6699 market6699 = new Market6699();
        market6699.setName("永辉超市");
        //将p1,p1的name存进购买清单中
        market6699.setProductList(new Product6699[] {p1,p2});
        Person6699 p = new Person6699();
        p.setName("张木强");
        String pro = p.shopping(market6699,market6699.getProductList());
        if (pro !=null){
            System.out.println(p.getName()+"的购物清单："
                    + Arrays.toString(market6699.getProductList()));
            System.out.println(p.getName()+"在"+market6699.getName()+"买到了："+pro);
        }
    }
}
